<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <title>Grid布局</title>

    <style>
        body,
        html {
            margin: 0;
            padding: 0;
            height: 100%;
            width: 100%;
        }
        .container {
            width: 30%;
            height: 100%;
            display: grid;
            grid-template-rows: repeat(3, 33.33%);
            row-gap: 4px;
            column-gap: 4px;
        }

        .left {
            background-color: blueviolet;
        }
        .middle {
            background-color: brown;
        }
        .right {
            background-color: aqua;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="left">上</div>
        <div class="middle">中</div>
        <div class="right">下</div>
    </div>

</body>

</html>